---
name: "pg_autoctl config set"
section: "1"
platform: "linux"
package: "pg-auto-failover-cli"
version: "2.2-2"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/pg_autoctl config set"
---

# pg\_autoctl config set(1)

pg\_autoctl config set pg\_autoctl config set - Set the value of a given pg\_autoctl configuration variable

## NAME

pg\_autoctl config set - pg\_autoctl config set

pg\_autoctl config set - Set the value of a given pg\_autoctl configuration variable

## SYNOPSIS

This command prints a **pg\_autoctl** configuration setting:

```
usage: pg_autoctl config set  [ --pgdata ] [ --json ] section.option [ value ]
--pgdata      path to data directory
```

## OPTIONS

- **--pgdata**

  Location of the Postgres node being managed locally. Defaults to the environment variable **PGDATA**. Use **--monitor** to connect to a monitor from anywhere, rather than the monitor URI used by a local Postgres node managed with **pg\_autoctl**.

- **--json**

  Output JSON formatted data.

## ENVIRONMENT

PGDATA

Postgres directory location. Can be used instead of the **--pgdata** option.

PG\_AUTOCTL\_MONITOR

Postgres URI to connect to the monitor node, can be used instead of the **--monitor** option.

XDG\_CONFIG\_HOME

The pg\_autoctl command stores its configuration files in the standard place XDG\_CONFIG\_HOME. See the *XDG Base Directory Specification*.

XDG\_DATA\_HOME

The pg\_autoctl command stores its internal states files in the standard place XDG\_DATA\_HOME, which defaults to **~/.local/share**. See the *XDG* *Base Directory Specification*.

## DESCRIPTION

This commands allows to set a pg\_autoctl configuration setting to a new value. Most settings are possible to change and can be reloaded online.

Some of those commands can then be applied with a **pg\_autoctl reload** command to an already running process.

## SETTINGS

pg\_autoctl.role

This setting can not be changed. It can be either **monitor** or **keeper** and the rest of the configuration file is read depending on this value.

pg\_autoctl.monitor

URI of the pg\_autoctl monitor Postgres service. Can be changed with a reload.

To register an existing node to a new monitor, use **pg\_autoctl disable** **monitor** and then **pg\_autoctl enable monitor**.

pg\_autoctl.formation

Formation to which this node has been registered. Changing this setting is not supported.

pg\_autoctl.group

Group in which this node has been registered. Changing this setting is not supported.

pg\_autoctl.name

Name of the node as known to the monitor and listed in **pg\_autoctl show** **state**. Can be changed with a reload.

pg\_autoctl.hostname

Hostname or IP address of the node, as known to the monitor. Can be changed with a reload.

pg\_autoctl.nodekind

This setting can not be changed and depends on the command that has been used to create this pg\_autoctl node.

postgresql.pgdata

Directory where the managed Postgres instance is to be created (or found) and managed. Can't be changed.

postgresql.pg\_ctl

Path to the **pg\_ctl** tool used to manage this Postgres instance. Absolute path depends on the major version of Postgres and looks like **/usr/lib/postgresql/13/bin/pg\_ctl** when using a debian or ubuntu OS.

Can be changed after a major upgrade of Postgres.

postgresql.dbname

Name of the database that is used to connect to Postgres. Can be changed, but then must be changed manually on the monitor's **pgautofailover.formation** table with a SQL command.

**WARNING:**

When using pg\_auto\_failover enterprise edition with Citus support, this is the database where pg\_autoctl maintains the list of Citus nodes on the coordinator. Using the same database name as your application that uses Citus is then crucial.

postgresql.host

Hostname to use in connection strings when connecting from the local **pg\_autoctl** process to the local Postgres database. Defaults to using the Operating System default value for the Unix Domain Socket directory, either **/tmp** or when using debian or ubuntu **/var/run/postgresql**.

Can be changed with a reload.

postgresql.port

Port on which Postgres should be managed. Can be changed offline, between a **pg\_autoctl stop** and a subsequent **pg\_autoctl start**.

postgresql.listen\_addresses

Value to set to Postgres parameter of the same name. At the moment **pg\_autoctl** only supports a single address for this parameter.

postgresql.auth\_method

Authentication method to use when editing HBA rules to allow the Postgres nodes of a formation to connect to each other, and to the monitor, and to allow the monitor to connect to the nodes.

Can be changed online with a reload, but actually adding new HBA rules requires a restart of the "node-active" service.

postgresql.hba\_level

This setting reflects the choice of **--skip-pg-hba** or **--pg-hba-lan** that has been used when creating this pg\_autoctl node. Can be changed with a reload, though the HBA rules that have been previously added will not get removed.

ssl.active, ssl.sslmode, ssl.cert\_file, ssl.key\_file, etc

Please use the command **pg\_autoctl enable ssl** or **pg\_autoctl disable** **ssl** to manage the SSL settings in the **ssl** section of the configuration. Using those commands, the settings can be changed online.

replication.maximum\_backup\_rate

Used as a parameter to **pg\_basebackup**, defaults to **100M**. Can be changed with a reload. Changing this value does not affect an already running **pg\_basebackup** command.

Limiting the bandwidth used by **pg\_basebackup** makes the operation slower, and still has the advantage of limiting the impact on the disks of the primary server.

replication.backup\_directory

Target location of the **pg\_basebackup** command used by pg\_autoctl when creating a secondary node. When done with fetching the data over the network, then pg\_autoctl uses the *[rename(2)](/rename/2.md)* system-call to rename the temporary download location to the target PGDATA location.

The *[rename(2)](/rename/2.md)* system-call is known to be atomic when both the source and the target of the operation are using the same file system / mount point.

Can be changed online with a reload, will not affect already running **pg\_basebackup** sub-processes.

replication.password

Used as a parameter in the connection string to the upstream Postgres node. The "replication" connection uses the password set-up in the pg\_autoctl configuration file.

Changing the **replication.password** of a pg\_autoctl configuration has no effect on the Postgres database itself. The password must match what the Postgres upstream node expects, which can be set with the following SQL command run on the upstream server (primary or other standby node):

```
alter user pgautofailover_replicator password 'h4ckm3m0r3';
```

The **replication.password** can be changed online with a reload, but requires restarting the Postgres service to be activated. Postgres only reads the **primary\_conninfo** connection string at start-up, up to and including Postgres 12. With Postgres 13 and following, it is possible to *reload* this Postgres parameter.

timeout.network\_partition\_timeout

Timeout (in seconds) that pg\_autoctl waits before deciding that it is on the losing side of a network partition. When pg\_autoctl fails to connect to the monitor and when the local Postgres instance **pg\_stat\_replication** system view is empty, and after this many seconds have passed, then pg\_autoctl demotes itself.

Can be changed with a reload.

timeout.prepare\_promotion\_catchup

Currently not used in the source code. Can be changed with a reload.

timeout.prepare\_promotion\_walreceiver

Currently not used in the source code. Can be changed with a reload.

timeout.postgresql\_restart\_failure\_timeout

When pg\_autoctl fails to start Postgres for at least this duration from the first attempt, then it starts reporting that Postgres is not running to the monitor, which might then decide to implement a failover.

Can be changed with a reload.

timeout.postgresql\_restart\_failure\_max\_retries

When pg\_autoctl fails to start Postgres for at least this many times then it starts reporting that Postgres is not running to the monitor, which them might decide to implement a failover.

Can be changed with a reload.

## AUTHOR

Microsoft

## COPYRIGHT

Copyright (c) Microsoft Corporation. All rights reserved.
